package com.teradata.factory.simple;

import com.teradata.factory.Mengniu;
import com.teradata.factory.Milk;
import com.teradata.factory.Telunsu;
import com.teradata.factory.Yili;

public class SimpleFactory {
    public Milk getMilk(String name) {
        if ("特仑苏".equals(name)){
            return new Telunsu();
        } else if ("伊利".equals(name)){
            return new Yili();
        } else if ("蒙牛".equals(name)){
            return new Mengniu();
        } else {
            System.out.println("不能生产您所需的产品.");
            return null;
        }

    }
}
